package com.bdqn.ch03.SZ.sz2;


import com.bdqn.ch03.SZ.sz1.Calculate;
import com.bdqn.ch03.SZ.sz1.Controller;

/**
 * CalculateFactoryTest 工厂测试类
 *
 * @aurhor Administrator  whs
 * @since 2024/7/5
 */
public class CalculateFactoryTest {
    public static void main(String[] args) {

        double num1 = 511.95;
        double num2 = 8.05;

        /**
         * 加法工厂
         */
        CalculateFactory Add = new AddCalculateFactory();
        double add = Add.createCalculate().Calculates(num1, num2);
        System.out.println("加法工厂===> " + num1 + " + " + num2 + " = " + add + "\n");

        /**
         * 减法工厂
         */
        CalculateFactory Minus = new MinusCalculateFactory();
        double minus = Minus.createCalculate().Calculates(num1, num2);
        System.out.println("减法工厂===> " + num1 + " - " + num2 + " = " + minus + "\n");

        /**
         * 除法工厂
         */
        CalculateFactory Divide = new DivideCalculateFactory();
        double divide = Divide.createCalculate().Calculates(num1,num2);
        System.out.println("除法工厂===> " + num1 + " / " + num2 + " = " + divide + "\n");


        /**
         * 除法工厂
         */
        CalculateFactory Ride = new RideCalculateFactory();
        double ride = Ride.createCalculate().Calculates(num1,num2);
        System.out.println("除法工厂===> " + num1 + " * " + num2 + " = " + ride + "\n");

        /**
         * 取模工厂
         */
        CalculateFactory Remainder = new RemainderCalculateFactory();
        double remainder = Remainder.createCalculate().Calculates(num1,num2);
        System.out.println("取模工厂===> " + num1 + " % " + num2 + " = " + remainder + "\n");

    }
}
